<template>
  <div id="ranking-board">
    <div class="ranking-board-title">缺陷种类及对应数量</div>
    <dv-scroll-ranking-board :config="config" />
  </div>
</template>

<script setup lang="ts" name="RankingBoard">
import { toRefs, PropType, ref, reactive } from 'vue'

const props = defineProps({
  tileData: {
    type: Object,
    default: {}
  }
})
let { tileData } = toRefs(props)
const defectsObjData = tileData.value.defectsObjData
let config = reactive({
  data: [
    {
      name: '边异常',
      value: defectsObjData.missEdge
    },
    {
      name: '角异常',
      value: defectsObjData.missConer
    },
    {
      name: '浅色块瑕疵',
      value: defectsObjData.sameSpot
    },
    {
      name: '白色点瑕疵',
      value: defectsObjData.differentSpot
    },
    {
      name: '针孔_熔洞',
      value: defectsObjData.karstCave
    }
  ],
  rowNum: 5
})
</script>

<style scoped>
#ranking-board {
  width: 20%;
  box-shadow: 0 0 3px blue;
  display: flex;
  flex-direction: column;
  background-color: rgba(6, 30, 93, 0.5);
  border-top: 2px solid rgba(1, 153, 209, 0.5);
  box-sizing: border-box;
  padding: 0px 30px 20px;
}
.ranking-board-title {
  font-weight: bold;
  height: 50px;
  display: flex;
  align-items: center;
  font-size: 24px;
}

.dv-scroll-ranking-board {
  flex: 1;
  align-items: center;
}
:deep(.dv-scroll-ranking-board .ranking-info) {
  font-size: 20px;
}
:deep(.dv-scroll-ranking-board .ranking-info .rank) {
  width: 80px;
}
</style>
